<?php

namespace App\Supports\Payment\Methods;

use App\Supports\Payment\Contracts\PayChannel;

class Method
{
	/**
	 * @var PayChannel
	 */
	protected $channel;
	
	public function setChannel($channel)
	{
		$this->channel = $channel;
	}
	
	protected function getPaidCode($outTradeNumber)
	{
		// ['order' => '201...']
		return explode('_', $outTradeNumber);
	}
	
	protected function getPaidTag($outTradeNumber)
	{
		$number = $this->getPaidCode($outTradeNumber);
		return $number[0];
		//return $number->implode('_');
	}
	
	protected function getPaidNumber($outTradeNumber)
	{
		$number = $this->getPaidCode($outTradeNumber);
		array_shift($number);

		return implode("_",$number);
	}
}
